package fileby.ctrl.actions.impl;

import fileby.model.IMagicBoxManager;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

/**
 *
 * @author Ludwig Kjellstrom
 */
class ImportMagicBoxAction extends AbstractAction {

    private IMagicBoxManager magicBoxManager;

    public ImportMagicBoxAction(IMagicBoxManager magicBoxManager) {
        super("Import Magic Box", null);
        this.magicBoxManager = magicBoxManager;
        putValue(SHORT_DESCRIPTION, "Add the contents of the current folder to the Magic Box");
        putValue(MNEMONIC_KEY, KeyEvent.VK_I);
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
                InputEvent.CTRL_DOWN_MASK));
    }

    public void actionPerformed(ActionEvent e) {
        magicBoxManager.importMagicBox();
    }
}
